<template>
    <div class="page-wrapper">
        <div class="header">
            <span class="header-title">战略微头条</span>
            <button class="exit-btn" @click="gotoPublish">退出预览</button>
        </div>
        <div class="phone-mock">
            <div class="status-bar">
                <span class="time">9:41</span>
                <div class="icons">
                    <span class="signal">1</span>
                    <span class="wifi">2</span>
                    <span class="battery">3</span>
                </div>
            </div>
            <div class="app-header">
                战略微头条
            </div>
            <router-view></router-view>
        </div>
    </div>
</template>

<script setup lang="ts">
    import { useRouter } from 'vue-router';
    const router = useRouter();
    const gotoPublish = () => {
        router.push('/newspublish');
    }
</script>

<style scoped>
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
}

.logo {
    height: 30px;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
}

.exit-btn {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.phone-mock {
    width: 375px;
    height: 667px;
    border: 8px solid #000;
    border-radius: 36px;
    overflow: hidden;
    margin: 20px 0;
    position: relative;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    font-size: 14px;
}

.icons {
    display: flex;
    gap: 5px;
}

.signal,
.wifi,
.battery {
    font-size: 16px;
}

.app-header {
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: bold;
}
</style>